x = -10:0.1:10;
y = zeros(1,length(x));
y(x>=-0.5 & x<= 0.5)=1;
%plot(x,y),axis([-10 10 -4 4]);title('rect function');
ctr = 1;
y3d = zeros(11,length(x));
for a = 0.0 : 0.05 : 1.0
    f = frft(y,a);
    y3d(ctr,:)=f;
    t = sprintf('a = %.1f',a);
    %figure,plot(x,abs(f)),axis([-10 10 -2 2]),title(t);
    ctr = ctr + 1;
end

figure,surf(abs(y3d)),ylabel('a'),xlabel('FRT'),title('FRT of the rect function');
